package com.common.android.utils.db;

import com.common.android.utils.smiley.SmileyHistoryDao;

public class CommonDaoFactory {
    private static CommonDaoFactory instance;
    private SmileyHistoryDao mSmileyHistoryDao;
    private CommonDaoFactory(){}
    
    public static CommonDaoFactory getInstance(){
        //这边加判空是因为99游切换用户后表情数据库要重新加载，
        //按理说我没有把instance置为null是不要这个判空的，
        //但是这个instance会莫名的变为空，所以加了这句。
        //更改人：陈友平(123210)
        if (instance==null){
            instance=new CommonDaoFactory();
        }
        return instance;
    }
    
    public SmileyHistoryDao getSmileyHistoryDao(){
        if (mSmileyHistoryDao==null){
            mSmileyHistoryDao=new SmileyHistoryDao();
        }
        return mSmileyHistoryDao;
    }
    
    public void clear(){
        mSmileyHistoryDao=null;
    }
}
